home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
basic
/
rodent.zip
/
GMOUSE.DOC
< prev
next >
Wrap
Text File
|
1987-09-28
|
29KB
|
1,273 lines
GMOUSE.DOC - GENIUS MOUSE Programming Interface
Programmer's Reference Manual
GENIUS-MOUSE DRIVER
Serial Mouse Version
Release 7.01
KUN YING ENTERPRISE CO.,LTD.
RM. 1311,NO.41,SEC 1,
CHUNG HSIAO W. RD.
TAIPEI, TAIWAN, R.O.C.
P.O. BOX: 22826 TAIPEI
TEL: 3813682 3318779 3118545 3822228
TELEX: 11388 KUNYING
FAX: 2-361-5300
page 1
Introduction
The following provides information to programmers who want
to include support for GENIUS-MOUSE in their application
programs. This document includes descriptions of the
graphics and text cursors, and descriptions of the mouse
functions.
This protocol is compatible with the protocol of Microsoft
Corp. as it is documented in the installation and operation
manual published by Microsoft Corp. entitled Microsoft (R)
Mouse User's Guide for IBM (R) Personal Computers.
These notes apply to the GENIUS Serial Mouse Driver
(mouse.com and mouse.sys) Release 5.01.
Cursor Descriptions - Text and Graphics Cursors
The characteristics of the cursor are determined by
Functions 9 and 10. GENIUS MOUSE has both text and graphics
cursors available. The graphics cursor is a shape that
moves over the images on the screen. The shape can include
an arrow, a sight mark, or others. The software text cursor
is a character attribute that moves from character to
character on the screen. The hardware text cursor is a
moving, sometimes flashing block which also moves from
character to character on the screen. The three cursors are
exclusive - only one can be on the screen at one time. You
have the option of choosing which cursor will appear on the
screen and of switching from one cursor to the other.
Graphics Cursor
The graphics cursor is an array of pixels (normally 16 by
16). It is defined by two arrays of bits called the screen
mask and the cursor mask.
The screen mask is used to determine which of the cursor
pixels becomes are part of the shape (1) or of the
background (0) (it is ANDed with the screen contents). The
cursor mask is used to determine which of the pixels of the
cursors contribute to the color/shape of the cursor (it is
XORed with the result of the previous operation).
page 2
The operational behaviour of these bit arrays are
summarized by the following table:
screen mask cursor mask resulting screen bit
0 0 0
0 1 1
1 0 unchanged
1 1 inverted
Note that when a mouse function refers to the graphics
cursor location it is referring to the point on the screen
that lies directly under the cursor's target area. The
target area is the point in the cursor block that the mouse
software uses to determine the cursor coordinates. This
point is called the hot spot of the cursor. The upper left
corner of the cursor block is the hot spot for the default
graphic cursor.
Text Cursor
The text cursor is a cursor that can be used when the video
is in one of the text modes.
Two kind of text cursors are supported: a hardware text
cursor and a software text cursor.
The hardware text cursor is the cursor actually placed on
the screen by the video controller itself. It is defined in
terms of the scan lines of the character cell numbered from
0 starting from the top scan line. The numbers of scan
lines on a character cell depends on the actual video
controller and monitor (see the controller documentation
for details).
The software text cursor is a character or a character
attribute that replaces and/or modifies the character cell
on the screen where it is positioned.
The behaviour of this cursor is defined by 2 16-bit values.
The format of the two values is the following:
bit description
15 blinking (1) or non blinking (0) character
14-12 background color
11 high intensity (1) or medium intensity (0)
10-8 foreground color
7-0 character code
page 3
The two values are called the screen mask and the cursor
mask. The screen mask is used to determine which of the
character attributes are preserved (it is ANDed with the
screen character and attribute). The cursor mask is used
to determine which of the characteristics are changed by
the cursor (it is XORed with the result of the previous
operation).
Notice to System Programmers
System programmers who intercept the video i/o software
interrupt (int 10h) should exercise utmost care, and note
the following:
The program should guarantee that video mode changes
(function 0) are intercepted by the mouse driver. The mouse
driver guarantees consistency of the screen contents to
programs that write on the screen via int 10h (or via
DOS).
Some programs write directly on the video memory. In this
case the application program should use function 2 (hide
cursor) or 16 (conditional hide cursor) before writing,
then function 1 (show cursor) after writing. GWBASIC is an
example of such a program.
The presence of the mouse driver can also be detected by
checking the interrupt vector entry for interrupt 51 in low
memory for value 0 or for pointing to an IRET instruction.
This method should be used with some care as it is
dependent on the release of DOS.
The programming interface uses the 8086 software interrupt
51. Parameter values are passed and returned via 8086
registers. This interface can be used from assembly
language programs or from high level language programs such
as BASIC , FORTRAN , COBOL , C or Pascal.
You can also let the mouse software call a subroutine in your
program whenever a specific condition occurs. When this
capability is enabled, the mouse software interrupts whatever
process is going on and passes execution control to the
subroutine that you have specified in Function 12 of the mouse
system calls.
page 4
Making Calls From Assembly Language Programs :
TO make mouse systemcalls from an assembly language program,
you must:
1. Load the AX, BX, CX and DX registers with the parameter
values.
2. Execute software interrupt 51(33H)
The AX, BX, CX and DX registers correspond to the M1%,
M2%, M3%, and M4% parameters. defined for the BASIC program.
Values returned by the Mouse functions will be placed in the
registers.
Example
Use the following instructions to set the cursor position to 150
(horizontal) and 100 (vertical):
; * set cursor to location (150,100)
Mov AX,4 ;(function call 4)
Mov CX,150 ;(set Horiziontal to 150)
Mov DX,100 ;(set vertical to 100)
Int 51 ;(interrupt to mouse)
Note: When making a mouse system call in Assembly Language,
function 9 and 12 expect a somewhat different.
Value for the fourth parameter than when calling from a
Basic program.
page 5
Making Calls from BASIC (BASICA) Language Program :
It is possible to make a mouse system call from a BASIC
program running under the GWBASIC interpreter. The
following shows how to make these calls.
Insert an initialization sequence such as:
10 DEF SEG=0
20 MSEG=256*PEEK(51*4+3)+PEEK(51*4+2)
30 MOUSE=256*PEEK(51*4+1)+PEEK(51*4)+2
40 DEF SEG=MSEG
Be sure that the statements appear before any calls to
mouse functions. Then use the CALL statement to make the
call.
CALL MOUSE(M1%,M2%,M3%,M4%)
where MOUSE is the variable containing the entry offset of
the mouse software, and M1%, M2%, M3%, and M4% are the
names of the integer variables you have chosen for
parameters in this call. They correspond to the values for
AX, BX, CX, and DX which are described in this document.
As an example:
100 'Set minimum and maximum horizontal position to
'(320,100)
200 M1%=7 'function number is 7
300 M3%=0 'minimum coordinate
400 M4%=639 'maximum coordinate
500 CALL MOUSE(M1%,M2%,M3%,M4%)
page 6
List of Mouse Functions
The f